/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
	"gctl/internal/sql2pb"

	"github.com/spf13/cobra"
)

// sql2pbCmd represents the sql2pb command
var sql2pbCmd = &cobra.Command{
	Use:   "sql2pb",
	Short: "A brief description of your command",
	Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:

Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
	Run: sql2pb.Sql2PBRoute,
}

func init() {
	rootCmd.AddCommand(sql2pbCmd)

	//sql2proto
	sql2pbCmd.Flags().String("db", "mysql", "the database type")
	sql2pbCmd.Flags().String("host", "localhost", "the database type")
	sql2pbCmd.Flags().Int("port", 3306, "the database port")
	sql2pbCmd.Flags().String("user", "root", "the database user")
	sql2pbCmd.Flags().String("password", "", "the database password")
	sql2pbCmd.Flags().String("schema", "", "the database schema")
	sql2pbCmd.Flags().String("table", "", "the table schema，multiple tables ',' split. ")
	sql2pbCmd.Flags().String("service_name", "", "the protobuf service name , defaults to the database schema.")
	sql2pbCmd.Flags().String("package", "", "the protocol buffer package. defaults to the database schema.")
	sql2pbCmd.Flags().String("go_package", "", "the protocol buffer go_package. defaults to the database schema.")
	sql2pbCmd.Flags().String("ignore_tables", "", "a comma spaced list of tables to ignore")
	sql2pbCmd.Flags().String("ignore_columns", "", "a comma spaced list of mysql columns to ignore")
	sql2pbCmd.Flags().String("field_style", "", "gen protobuf field style, sql_pb | sqlPb")

	//proto2pb
	sql2pbCmd.Flags().String("proto", "", "the protocol buffer file path.")

}
